package net.dopan.pigframe.user.service.impl;

import net.dopan.pigframe.core.base.service.impl.BaseServiceImpl;
import net.dopan.pigframe.core.utils.Assert;
import net.dopan.pigframe.core.utils.CommonConstant;
import net.dopan.pigframe.core.model.SysLog;
import net.dopan.pigframe.user.mapper.SysLogMapper;
import net.dopan.pigframe.user.service.SysLogService;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * @Package: net.dopan.pigframe.user.service.impl
 * @Title: SysLogServiceImpl
 * @Description: 日志表 服务实现类
 * @author: 刘宽
 * @date: 2018/9/2 21:16
 */
@Service
public class SysLogServiceImpl extends BaseServiceImpl<SysLogMapper, SysLog> implements SysLogService {

    @Override
    public Boolean updateByLogId(Long id) {
        Assert.isNull(id, "日志ID为空");

        SysLog sysLog = new SysLog();
        sysLog.setId(id);
        sysLog.setDelFlag(CommonConstant.STATUS_DEL);
        sysLog.setUpdateTime(new Date());
        return updateById(sysLog);
    }
}
